<%@page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"
import="java.util.*"%>
<%@page import="bean.*"%>
<%@page import="service.*"%>
<%@page import="DAO.*"%>
<%@page import="servlet.*"%>



<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
     <style type="text/css">
     a:link {color: black}          /* 未访问的链接 */
     a:link {text-decoration: none;}     /* 去掉下划线 */
     a:visited {color: black}       /* 已访问的链接 */
     a:hover {color: black}             /* 鼠标移动到链接上 */
     a:active {color:black}         /* 选定的链接 */
    </style>
        <script>
   	function fun(val){
   		var r=confirm("确认删除吗？");
   		if(r){
   			location.href="DesServlet?op=del&pet_id="+val;
   		}
   	}
   </script>


    </head>
     <body >
        <form>
        
        <h3 align="center">阅览病例</h3>
        <br>
        
        <table border="1" align="center" style="position:relative" width=600 height=200
        cellpadding=0 cellspacing=0>  <!-- 表格透明 -->
            
            <tr>
                <th align="center">宠物编号</th>
                <th align="center">主治医生</th>
                <th align="center">疾病描述</th>
                <th align="center">看病日期</th>  
                 <th align="center">删除按钮</th>  
            </tr>
    
      <%
    	     IDesDao dao = DaoFactory.getDesDao();
    		Map<String,Object> map = null;
    		List<Descriptionbean> list = dao.queryDes(map);
    		for(Descriptionbean p:list){
    		%>
    		<tr>
    			<td><%=p.getPet_id()   %></td>
    			<td><%=p.getDoctor() %></td>
    			<td><%=p.getSickness()   %></td>
    			<td><%=p.getData()%></td>
    			<td><a href="javascript:void(0);" onclick="fun(<%=p.getPet_id() %>)">删除</a></td>
    		</tr>
    		<%} %>

       
      </table>
    </form>
    </body>
</html>
